]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
css/quick-settings: Update icon-button styles
authorSam Hewitt <sam@snwh.org>
Thu, 13 Oct 2022 16:51:17 +0000 (14:21 -0230)
committerMarge Bot <marge-bot@gnome.org>
Tue, 18 Oct 2022 19:43:10 +0000 (19:43 +0000)
- add an entire flat style to button drawing function
- clean up the icon button css in quick settings
- adjust padding in QS sliders
- fixes #5918

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2510>

data/theme/gnome-shell-sass/_common.scss
data/theme/gnome-shell-sass/_drawing.scss
data/theme/gnome-shell-sass/widgets/_buttons.scss
data/theme/gnome-shell-sass/widgets/_quick-settings.scss
js/ui/quickSettings.js

index f2fe78a3c6d2404df48e9003c14c2e1c3f54c99f..9ca89d182bd8954c6831a28bb436c3f8fdc5ad5b 100644 (file)
@@ -105,24 +105,15 @@ stage {
   &:insensitive { @include button(insensitive);}
   &:active { @include button(active);}
   &:checked { @include button(checked);}
-}
-
-// normal icon-only button
-%icon_button {
-  border-radius: 99px;
-  border-style: solid;
-  border-width: 1px;
-  font-weight: bold;
-  padding: $base_padding*2;
-
-  @include button(normal);
-  &:focus { @include button(focus);}
-  &:hover { @include button(hover);}
-  &:insensitive { @include button(insensitive);}
-  &:active { @include button(active);}
-  &:checked { @include button(checked);}
 
-  & > StIcon { icon-size: $base_icon_size; }
+  &.flat {
+    @include button(normal, $flat:true);
+    &:focus { @include button(focus, $flat:true);}
+    &:hover { @include button(hover, $flat:true);}
+    &:insensitive { @include button(insensitive, $flat:true);}
+    &:active { @include button(active, $flat:true);}
+    &:checked { @include button(checked, $flat:true);}
+  }
 }
 
 // buttons in dialogs/notifications
@@ -143,9 +134,9 @@ $bubble_button_radius:$base_border_radius*1.25;
   &:hover { @include button(hover, $c:$bubble_buttons_color);}
   &:active { @include button(active, $c:$bubble_buttons_color);}
   &:checked { @include button(checked, $c:$bubble_buttons_color);}
-  
+
   &:first-child:ltr {
-    border-radius: 0 0 0 $bubble_button_radius; 
+    border-radius: 0 0 0 $bubble_button_radius;
   }
 
   &:last-child:ltr {
index 0e51f935b34084e640d527e8bce0a78eb687eaf7..7c8959e2cf7349e92b7c2d31edda27736869aec2 100644 (file)
 //
 // since buttons are all flat an borderless now the mixin is simpler
 
-@mixin button($t, $tc:$fg_color, $c:$bg_color) {
+@mixin button($t, $tc:$fg_color, $c:$bg_color, $flat: false) {
 
   $button_bg_color: mix($tc, $c, $button_mix_factor);
   transition-duration: 100ms;
   @if $t==normal {
     color: $tc;
     background-color: $button_bg_color;
+    @if $flat {
+      background-color: transparent;
+    }
     @if $is_highcontrast == "true" {
       box-shadow: inset 0 0 0 1px $button_inset_color;
     }
index df995245527bbe8aaa6b455d60b93fc23571b276..def96fe8cdd1283ae41fdb948929f75477720e8b 100644 (file)
@@ -6,5 +6,14 @@
 }
 
 .icon-button {
-  @extend %icon_button; // that's it
-}
+  @extend .button; // same style as buttons
+
+  border-radius: 99px;
+  padding: $base_padding*2;
+  min-height: 16px;
+
+  StIcon {
+    icon-size: $base_icon_size;
+    -st-icon-style: symbolic;
+  }
+}
\ No newline at end of file
index 4e84cdf6f41767e35c55872c4ad2cb35d405c094..b429a2dc50e65f9ab83950841c5be0b5b5327253 100644 (file)
@@ -48,8 +48,6 @@
 }
 
 .quick-slider {
-  padding: 0 $base_padding;
-
   & > StBoxLayout { spacing: $base_padding; }
 
   .slider-bin {
     padding: $base_padding;
     border-radius: 99px;
   }
-  .quick-toggle-icon { icon-size: $base_icon_size; }
-  .icon-button { background-color: transparent; }
+  .quick-toggle-icon {
+    icon-size: $base_icon_size;
+
+    &:ltr { margin-left: $base_padding; }
+    &:rtl { margin-right: $base_padding; }
+  }
 }
 
 .quick-toggle-menu {
 .quick-settings-system-item {
   & > StBoxLayout { spacing: 2 * $base_padding; }
 
-  .icon-button > StIcon { -st-icon-style: symbolic; }
-
   & .power-item {
     min-height: 0;
     min-width: 0;
index 7a31d561d41ec601217391415302765065d8ed8a..f407414df33f2de2c1295b8db7ecf7fcb5224c1f 100644 (file)
@@ -198,7 +198,7 @@ var QuickSlider = GObject.registerClass({
 
         this._menuButton = new St.Button({
             child: new St.Icon({icon_name: 'go-next-symbolic'}),
-            style_class: 'icon-button',
+            style_class: 'icon-button flat',
             can_focus: true,
             x_expand: false,
             y_expand: true,